package com.sqx.modules.tbOrders.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sqx.modules.tbOrders.entity.TbOrders;
import com.sqx.modules.tbOrders.entity.vo.TbOrdersVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author Admin
 * @description 针对表【tb_orders(商品订单)】的数据库操作Mapper
 * @createDate 2024-07-09 11:09:26
 * @Entity generator.domain.TbOrders
 */
@Mapper
public interface TbOrdersDao extends BaseMapper<TbOrders> {

    IPage<TbOrders> getAppTbOrdersList(@Param("pages") Page<TbOrders> pages,
                                       @Param("tbOrders") TbOrders tbOrders);

    IPage<TbOrders> getRecycleAppTbOrdersList(@Param("pages") Page<TbOrders> pages,
                                              @Param("tbOrders") TbOrders tbOrders);

    TbOrders getAppOrdersDetail(@Param("orderId") Long orderId,
                                @Param("userId") Long userId);

    IPage<TbOrdersVO> getTbOrdersList(@Param("pages") Page<TbOrdersVO> pages,
                                      @Param("startTime") String startTime,
                                      @Param("endTime") String endTime,
                                      @Param("tbOrdersVO") TbOrdersVO tbOrdersVO);

    IPage<TbOrdersVO> getTbOrdersListByType(@Param("pages") Page<TbOrdersVO> pages,
                                            @Param("startTime") String startTime,
                                            @Param("endTime") String endTime,
                                            @Param("tbOrdersVO") TbOrdersVO tbOrdersVO);

    TbOrders selectByUserId(@Param("userId") Long userId,
                            @Param("taskId") Long taskId);

    List<TbOrders> selectBySellerId(@Param("userId") Long userId);

    IPage<TbOrders> getAppTbOrdersBySellerList(@Param("pages") Page<TbOrders> pages,
                                               @Param("tbOrders") TbOrders tbOrders);

    List<TbOrders> getTbOrdersListByTurnover(@Param("pages") Page<TbOrders> pages);

    int updateRiderBalance(@Param("balance") BigDecimal balance, @Param("userId") Long userId);


    Integer selectOrdersCountStatisticsByYear(Integer flag, String time, Integer status);

    Integer queryOrdinaryCount(String date, Integer type);

    Integer queryRetrieveCount(String date, Integer type);

    BigDecimal queryRetrieveMoney(String date, Integer type);

    Integer selectObligationCount(String date, Integer type);

    Integer selectPaidCount(String date, Integer type);

    Integer selectCompletedCount(String date, Integer type);

    BigDecimal queryPlatformMoney(String date, Integer type);

    BigDecimal queryFirstMoney(String date, Integer type);

    BigDecimal querySecondMoney(String date, Integer type);

    BigDecimal queryRetrieveDaihuishou(String date, Integer type);

    BigDecimal queryRetrieveYiwancheng(String date, Integer type);

    BigDecimal queryRetrieveDaishouhuo(String date, Integer type);

    Integer countByRecycleUserId(Long userId);
}




